###############################################
# === xenomorph_captor_origins.txt ===
###############################################
###############################################
# XENOMORPH CAPTOR ORIGINS (non-hive empires)
#
# Two origins for empires that exploit Xenomorphs as a secondary species:
#  - origin_xeno_traffickers : a Megacorp built on selling and servicing
#    captive Xenomorphs and their Queens. Unlocks 3 corporate civics.
#  - origin_xeno_keepers : any non-hive empire that begins with an enslaved
#    Xenomorph population as livestock/labour.
###############################################

# --- ORIGIN: Xeno Traffickers (Megacorp) ---
origin_xeno_traffickers = {
	is_origin = yes
	icon = "gfx/interface/icons/origins/xenomorph_lab_escape.dds"
	picture = origin_xenomorph_lab_escape

	playable = {
		host_has_dlc = "Megacorp"
	}
	ai_playable = {
		host_has_dlc = "Megacorp"
	}

	possible = {
		authority = { value = auth_corporate }
		ethics = { NOT = { value = ethic_gestalt_consciousness } }
	}

	description = "origin_tooltip_xeno_traffickers_effects"

	# The Xenomorph is the secondary species, enslaved as stock-in-trade.
	has_secondary_species = {
		title = origin_xeno_traffickers_secondary_species
	}

	modifier = {
		# A trade empire with a captive brood for product.
		planet_jobs_trade_produces_mult = 0.2  # 3_63: merged 2 duplicates (F5 category-share)
		planet_crime_mult = 0.10
	}

	random_weight = {
		base = 1
	}
}

# --- ORIGIN: Xeno Keepers (any non-hive empire) ---
origin_xeno_keepers = {
	is_origin = yes
	icon = "gfx/interface/icons/origins/xenomorph_scattered_brood.dds"
	picture = origin_xenomorph_scattered_brood

	playable = {
		always = yes
	}

	possible = {
		ethics = { NOT = { value = ethic_gestalt_consciousness } }
	}

	description = "origin_tooltip_xeno_keepers_effects"

	# Begin with an enslaved Xenomorph secondary species.
	has_secondary_species = {
		title = origin_xeno_keepers_secondary_species
	}

	modifier = {
		# A head start in Xeno exploitation, but a restless captive brood.
		planet_amenities_mult = 0.10
		army_damage_mult = 0.10
		planet_stability_add = -5
	}

	random_weight = {
		base = 1
	}
}

###############################################
# === xenomorph_origins.txt ===
###############################################
#######################
###     Origins     ###
#######################

#############
# Xenomorph #
#############

# Xenomorph Prime
# Intended start setup, handled by on_game_start/event:
# - Capital becomes an infested/hive world or receives hive-world style deposits/modifiers.
# - Starts with one Empress ruler and several Queen/paladin-type royal units/buildings/jobs.
# - Strongest normal Xenomorph origin; not meant to be a challenge start.
origin_xenomorph_prime = {
	is_origin = yes
	icon = "gfx/interface/icons/origins/xenomorph_prime.dds"
	picture = origin_xenomorph_prime
	starting_colony = pc_xenomorph_hive
	habitability_preference = pc_hive
	preferred_planet_class_neighbor = no

	playable = {
		always = yes
	}

	possible = {
		authority = { value = auth_hive_mind }
	}

	description = "origin_tooltip_xenomorph_prime_effects"

	traits = {
		trait = trait_xenomorph
	}

	modifier = {
		# Prime hives are fully mature, coordinated, and already adapted to hive-world conditions.
		planet_jobs_produces_mult = 0.10
		logistic_growth_mult = 0.10
		pop_environment_tolerance = 0.10
		army_damage_mult = 0.15
		country_naval_cap_add = 20
	}

	random_weight = {
		base = 1
	}
}

# Lab Escape
# Intended start setup, handled by on_game_start/event:
# - Starts with a secondary non-Xenomorph slave species.
# - Slave/host pops outnumber the Xenomorph pops.
# - Early instability from containment collapse, but strong growth once hosts are controlled.
origin_xenomorph_lab_escape = {
	is_origin = yes
	icon = "gfx/interface/icons/origins/xenomorph_lab_escape.dds"
	picture = origin_xenomorph_lab_escape
	flags = { custom_start_screen }

	playable = {
		always = yes
	}

	possible = {
		authority = { value = auth_hive_mind }
	}

	description = "origin_tooltip_xenomorph_lab_escape_effects"

	traits = {
		trait = trait_xenomorph
		trait = trait_genetically_manipulated
	}

	# Player designs a secondary host species in the empire creator. They start
	# enslaved as Host Stock on the capital (see xenomorph_lab_escape_start.1).
	has_secondary_species = {
		title = civic_xenomorph_lab_escape_secondary_species
	}

	modifier = {
		# Escaped specimens learn fast, but the overgrown host population makes the opening unstable.
		species_leader_exp_gain = 0.15
		logistic_growth_mult = 0.10
		planet_jobs_society_research_produces_mult = 0.10
		planet_crime_mult = 0.15
		planet_stability_add = -5
	}

	random_weight = {
		base = 1
	}
}


# Queen Mother
# Progenitor Hive-style origin, Xenomorph version.
# Intended start setup, handled by on_game_start/event and scripted modifiers:
# - Capital starts as an infested/hive world.
# - Capital starts with a Queen Mother Throne capital building.
# - Capital starts with a Progenitor/Queen Mother Nest planetary feature.
# - Starting ruler is an immortal Queen Mother.
# - Spawns 4 Paladins on capital planet.
# - Paladins produce unity, reduce deviancy, and add minor pop growth.
# - Leaders gain passive monthly experience while the Queen Mother lives.
# - Leaders begin at level 3 while the Queen Mother lives.
# - Leaders cost more unity and have higher upkeep while the Queen Mother lives.
# - Allows sectors to be released as brood-subjects unless using devouring-style civics.
# - Replaces normal Spawning Pools with Royal Jelly Pools buildings.
# - Any colony without a Queen/Empress/Royal Jelly Pools suffers severe coordination penalties.
# - Can construct Brood Outpost starbase buildings.
# - Can design/build Royal Offspring escort ships.
# - Worlds without any actual Queen presence suffer menial drone output, stability, deviancy, and growth penalties.
# - Fleets and starbases without a Royal Offspring ship in-system suffer accuracy/evasion/fire-rate/sublight penalties.
# - If the capital/Queen Mother is lost, the empire suffers severe penalties until a new Queen Mother is grown.
# - Enables a Grow a New Queen Mother decision if the original Queen Mother dies or capital is lost.
origin_xenomorph_queen_mother = {
	is_origin = yes
	icon = "gfx/interface/icons/origins/xenomorph_queen_mother.dds"
	picture = origin_xenomorph_queen_mother
	starting_colony = pc_xenomorph_hive
	habitability_preference = pc_hive
	preferred_planet_class_neighbor = no

	playable = {
		always = yes
	}

	possible = {
		authority = { value = auth_hive_mind }
	}

	description = "origin_tooltip_xenomorph_queen_mother_effects"

	traits = {
		trait = trait_xenomorph
	}

	modifier = {
		# Centralized royal command structure.
		# Most Progenitor-style penalties/ship checks must be handled by scripted modifiers/events, not this origin block alone.
		planet_jobs_produces_mult = 0.10
		logistic_growth_mult = 0.15
		planet_jobs_unity_produces_mult = 0.15
		army_defense_damage_mult = 0.20

		# Leader side of the Queen Mother bond.
		species_leader_exp_gain = 0.15
		leaders_cost_mult = 0.50
		leaders_upkeep_mult = 0.25
	}

	# Capital setup fires via on_game_start -> xenogeneral.4 or a dedicated queen mother origin event.
	# Progenitor-style ship/world penalties should be added through static modifiers and scripted triggers.
	random_weight = {
		base = 1
	}
}

# Crashed Derelict
# Intended start setup, handled by on_game_start/event:
# - Starts as a primitive/near-primitive challenge empire.
# - Single Queen and a few hundred drones/pop group units.
# - Starts with weaker infrastructure and limited early economy, but gains derelict salvage/reverse-engineering bonuses.
origin_xenomorph_crashed_derelict = {
	is_origin = yes
	icon = "gfx/interface/icons/origins/xenomorph_crashed_derelict.dds"
	picture = origin_xenomorph_crashed_derelict

	playable = {
		always = yes
	}

	possible = {
		authority = { value = auth_hive_mind }
	}

	description = "origin_tooltip_xenomorph_crashed_derelict_effects"

	traits = {
		trait = trait_xenomorph
	}

	modifier = {
		# Challenge start: weak opening economy, strong salvage identity.
		planet_jobs_produces_mult = -0.10
		planet_buildings_cost_mult = 0.15
		all_technology_research_speed = -0.10
		country_engineering_tech_research_speed = 0.15
		ship_hull_regen_add_perc = 0.05
		logistic_growth_mult = 0.05
	}

	random_weight = {
		base = 1
	}
}


# Scattered Brood
origin_xenomorph_scattered_brood = {
	is_origin = yes
	icon = "gfx/interface/icons/origins/xenomorph_scattered_brood.dds"
	picture = origin_xenomorph_scattered_brood

	playable = {
		always = yes
	}

	possible = {
		authority = { value = auth_hive_mind }
	}

	description = "origin_tooltip_xenomorph_scattered_brood_effects"

	traits = {
		trait = trait_xenomorph
	}

	modifier = {
		# Many small broods adapt quickly and spread faster than a centralized hive.
		colonization_speed_mult = 0.25
		pop_environment_tolerance = 0.20
		planet_colony_development_speed_mult = 0.15
		planet_jobs_unity_produces_mult = -0.05
	}

	random_weight = {
		base = 1
	}
}
